/**
 * 
 */
package com.ginger.security.shiro.test;

import org.apache.shiro.crypto.hash.Md2Hash;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.apache.shiro.crypto.hash.Sha1Hash;
import org.apache.shiro.crypto.hash.Sha256Hash;
import org.apache.shiro.crypto.hash.Sha384Hash;
import org.apache.shiro.crypto.hash.Sha512Hash;

/**
 * @Description: 依赖shiro加密模块的加密方式展示
 * @author 姜锋
 * @date 2018年6月3日 下午12:25:32
 * @version V1.0
 */
public class Encryption {
	public void crypto() {
		String password = "This is my password";
		System.out.println("打印原密码:" + password);
		Md2Hash md2 = new Md2Hash(password);
		System.out.println("打印md2密码:" + md2.toString());
		Md5Hash md5 = new Md5Hash(password);
		System.out.println("打印ma5密码:" + md5.toString());
		Sha1Hash sha1Hash = new Sha1Hash(password);
		System.out.println("打印sha1Hash密码:" + sha1Hash.toString());
		Sha256Hash sha256Hash = new Sha256Hash(password);
		System.out.println("打印sha256Hash密码:" + sha256Hash.toString());
		Sha384Hash sha384Hash = new Sha384Hash(password);
		System.out.println("打印sha384Hash密码:" + sha384Hash.toString());
		Sha512Hash sha512Hash = new Sha512Hash(password);
		System.out.println("打印sha512Hash密码:" + sha512Hash.toString());
	}
}
